package com.ly.ql.Wms.utils;

import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * @Descri[tion: 返回请求上下文 HttpServletRequest
 * @Author
 */
@Component
public class HttpRequestContextUtils {
    public HttpServletRequest returnHttpRequest(){
        ServletRequestAttributes requestAttributes = ServletRequestAttributes.class.cast(RequestContextHolder.getRequestAttributes());
        HttpServletRequest contextRequest = requestAttributes.getRequest();
        return contextRequest;
    }

}
